

<section class="content-header">
	<h1>订单列表</h1>
	<ol class="breadcrumb">
		<li><a href="${basePath}"><i class="fa fa-dashboard"></i> 首页</a></li>
		<li><a href="#">服务管理</a></li>
		<li class="active">订单列表</li>
	</ol>
</section>

<!-- Main content -->
<section class="content" style="padding: 10px;">
	
<div class="nav-tabs-custom">
						<ul class="nav nav-tabs">
							<li class="active"><a href="#tab_1" data-toggle="tab">完整单</a></li>
							<li><a href="#tab_2" data-toggle="tab">暂存单</a></li>


						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="tab_1">
									<table id="bbb_table" data-showFooter="false" data-search="false" data-toggle="table"
										data-page-size="20"  data-pagination="true" >
										<thead>
											<tr>
												<th data-field="id">id</th>
												<th data-field="familyName">姓氏</th>
												<th data-field="givenName">名称</th>
												<th data-field="passport">护照号码</th>
												<th data-field="mobile">移动电话</th>
												<th data-field="strokeStartDate">行程开始日期</th>
												<th data-field="strokeEndDate">行程截止日期</th>
												<th data-field="status">订单状态</th>
												<th data-field="startDate">运行时间</th>
												<th data-field="endDate">终止时间</th>
												<th data-field="trn">网站订单号</th>
												<th data-field="antUsername">爬虫账户</th>
												<th data-field="step">已执行步骤</th>
												<th data-field="errorimage">错误状态截图</th>
												<th data-field="addTime">创建时间</th>
												<th data-formatter="showActBtns" >操作</th>
												
											</tr>
										</thead>
									</table>
							</div>
							<div class="tab-pane " id="tab_2">
									<table id="c_table" data-showFooter="false" data-search="false" data-toggle="table"
										data-page-size="20"  data-pagination="true" >
										<thead>
											<tr>
												<th data-field="id">id</th>
												<th data-field="familyName">姓氏</th>
												<th data-field="givenName">名称</th>
												<th data-field="passport">护照号码</th>
												<th data-field="mobile">移动电话</th>
												<th data-field="strokeStartDate">行程开始日期</th>
												<th data-field="strokeEndDate">行程截止日期</th>
												<th data-field="status">订单状态</th>
												<th data-field="startDate">运行时间</th>
												<th data-field="endDate">终止时间</th>
												<th data-field="trn">网站订单号</th>
												<th data-field="antUsername">爬虫账户</th>
												<th data-field="step">已执行步骤</th>
												<th data-field="errorimage">错误状态截图</th>
												<th data-field="addTime">创建时间</th>
												<th data-formatter="showTmpBtns" >操作</th>
											</tr>
										</thead>
									</table>
							</div>
						</div>
			</div>

</section>

<script type="text/javascript">
	$(function() {
		$('#bbb_table').bootstrapTable({
			url:context+'/order/listOrders?isTemp=0', 
		    dataType: "json",
		    pagination: true,
		    locale:"zh-US",
		    sidePagination: "server"
		});
		$('#c_table').bootstrapTable({
			url:context+'/order/listOrders?isTemp=1', 
		    dataType: "json",
		    pagination: true,
		    locale:"zh-US",
		    sidePagination: "server"
		});
		
		$('#c_table').on('click','button[data-role=edit-row]',function(){　　　
			 loadPage(context+'/order/add?id='+$(this).data("id"));
	    });
	});
	
	function showTmpBtns(value,row,index){
		 return `<button type="button" class="btn btn-block btn-default" data-index="${index}" data-id="${row.id}" data-role="edit-row">编辑</button>`;
	}
	
	function showActBtns(value,row,index){
		 return `<button type="button" class="btn btn-block btn-default" data-index="${index}" data-id="${row.id}" data-role="edit-run">运行</button>`;
	}
</script>
